Skip to content

Add zizmor GitHub Actions security scanning#3421

Merged
Mpdreamz merged 5 commits into
mainfrom
featue/zizmor
Jun 1, 2026
Merged

Add zizmor GitHub Actions security scanning#3421
Mpdreamz merged 5 commits into
mainfrom
featue/zizmor

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

@Mpdreamz Mpdreamz commented Jun 1, 2026

Why

GitHub Actions workflows were not statically audited for common misconfigurations (unpinned third-party actions, credential persistence, overly broad permissions, and related supply-chain risks). Without automated checks, regressions are easy to miss in review.

What

Adds a zizmor CI workflow and .github/zizmor.yml policy: actions/* and elastic/* may use ref pins; all other actions must be hash-pinned. Applies remediations across existing workflows (third-party SHA pins, scoped permissions, Dependabot cooldown, checkout credential hygiene, and targeted ignores for intentional pull_request_target usage) so zizmor . passes locally and in CI.

Made with Cursor

Introduce zizmor CI, policy config (hash-pin third-party actions;
ref-pin actions/* and elastic/*), and remediations so workflows pass
local audit cleanly.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Mpdreamz Mpdreamz requested a review from a team as a code owner June 1, 2026 11:02
@Mpdreamz Mpdreamz requested a review from cotti June 1, 2026 11:02
@Mpdreamz Mpdreamz added the automation packaging, ci/cd. label Jun 1, 2026
Replace file-level template-injection suppressions with per-site
comments so each ignored expansion is visible in review.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread .github/dependabot.yml Outdated
Align github-actions and nuget with npm (reakaleek review).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Correct ref-version-mismatch that caused zizmor CI to exit 13.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Warning

Review limit reached

@Mpdreamz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 56 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b1daa862-5a4b-4364-b922-b1220b9a76e4

📥 Commits

Reviewing files that changed from the base of the PR and between 0834f67 and 1d6c755.

📒 Files selected for processing (8)
  • .github/dependabot.yml
  • .github/workflows/assembler-preview.yml
  • .github/workflows/comment-on-asciidoc-changes.yml
  • .github/workflows/create-major-tag.yml
  • .github/workflows/docs-preview-local.yml
  • .github/workflows/release.yml
  • .github/workflows/smoke-test.yml
  • .github/zizmor.yml
📝 Walkthrough

Walkthrough

This PR implements comprehensive security hardening for GitHub Actions workflows by introducing Zizmor security scanning, disabling credential persistence across all workflows, scoping permissions to least-privilege at the job level, and pinning action versions to specific commit SHAs. Additional changes include updating Dependabot configuration with cooldown settings, refactoring environment variable handling in the update-link-index action, and adjusting workflow debugging output to use shell environment variables.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding zizmor GitHub Actions security scanning to the repository.
Description check ✅ Passed The description clearly explains the motivation, changes, and remediations applied across the workflows to enable zizmor security scanning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch featue/zizmor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jun 1, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/create-major-tag.yml (1)

18-28: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

git push will fail without credentials.

Setting persist-credentials: false removes the GITHUB_TOKEN from git config after checkout. The git push at line 28 will fail with an authentication error since no credentials are configured.

Options:

  1. Remove persist-credentials: false for this workflow (it needs write access for tagging)
  2. Explicitly configure credentials before push
🐛 Option 2: Explicitly configure credentials
       - uses: actions/checkout@v6
-        with:
-          persist-credentials: false
       - name: Get major version
         run: |
           MAJOR_VERSION=$(echo "${GITHUB_REF#refs/tags/}" | awk -F. '{print $1}')
           echo "MAJOR_VERSION=${MAJOR_VERSION}" >> "${GITHUB_ENV}"
       - name: Create major tag
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         run: |
+          git config user.name "github-actions[bot]"
+          git config user.email "github-actions[bot]`@users.noreply.github.com`"
+          git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}`@github.com/`${{ github.repository }}.git"
           git tag "v${MAJOR_VERSION}"
           git push -f origin "refs/tags/v${MAJOR_VERSION}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/create-major-tag.yml around lines 18 - 28, The workflow
currently disables credentials in the checkout step (persist-credentials: false)
but later runs the "Create major tag" step which runs git push using
MAJOR_VERSION; restore or provide credentials so git push succeeds: either
remove or set persist-credentials to true on the actions/checkout@v6 step, or
add a step before the "Create major tag" step to configure git credentials using
the GITHUB_TOKEN (e.g., set git remote auth or run actions/setup-auth) so the
git tag "v${MAJOR_VERSION}" push can authenticate successfully.
🧹 Nitpick comments (1)
.github/workflows/docs-preview-local.yml (1)

114-114: 💤 Low value

Inconsistent: unpinning actions/github-script while other actions are being SHA-pinned.

This PR pins third-party actions to SHAs for security, but this change moves from a pinned reference back to @v8. This appears inconsistent with the PR's security hardening goals.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docs-preview-local.yml at line 114, The workflow currently
unpins actions/github-script by using "uses: actions/github-script@v8" while
other actions are SHA-pinned; replace that line with a SHA-pinned reference
(e.g., "uses: actions/github-script@<commit-sha>") to match the repo's security
policy, by finding the latest commit SHA for actions/github-script and updating
the uses line so it references that specific SHA instead of "`@v8`".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/smoke-test.yml:
- Around line 47-49: The test command using the env var
STEPS_DOCS_BUILD_OUTPUTS_LANDING_PAGE_PATH is unquoted and uses "==" which
breaks when landing-page-path-output is empty; update the run step that
currently says `test ${STEPS_DOCS_BUILD_OUTPUTS_LANDING_PAGE_PATH} == ${{
matrix.landing-page-path-output }}` to quote both operands and use a
POSIX-compatible equals operator so it becomes `test
"${STEPS_DOCS_BUILD_OUTPUTS_LANDING_PAGE_PATH}" = "${{
matrix.landing-page-path-output }}"`, ensuring empty values do not produce a
"unary operator expected" error.

---

Outside diff comments:
In @.github/workflows/create-major-tag.yml:
- Around line 18-28: The workflow currently disables credentials in the checkout
step (persist-credentials: false) but later runs the "Create major tag" step
which runs git push using MAJOR_VERSION; restore or provide credentials so git
push succeeds: either remove or set persist-credentials to true on the
actions/checkout@v6 step, or add a step before the "Create major tag" step to
configure git credentials using the GITHUB_TOKEN (e.g., set git remote auth or
run actions/setup-auth) so the git tag "v${MAJOR_VERSION}" push can authenticate
successfully.

---

Nitpick comments:
In @.github/workflows/docs-preview-local.yml:
- Line 114: The workflow currently unpins actions/github-script by using "uses:
actions/github-script@v8" while other actions are SHA-pinned; replace that line
with a SHA-pinned reference (e.g., "uses: actions/github-script@<commit-sha>")
to match the repo's security policy, by finding the latest commit SHA for
actions/github-script and updating the uses line so it references that specific
SHA instead of "`@v8`".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3c237bd3-c946-4a8f-a720-7ff6684b87f9

📥 Commits

Reviewing files that changed from the base of the PR and between b38a552 and 0834f67.

📒 Files selected for processing (15)
  • .github/actions/bootstrap/action.yml
  • .github/dependabot.yml
  • .github/workflows/build-link-index-updater-lambda.yml
  • .github/workflows/ci.yml
  • .github/workflows/create-major-tag.yml
  • .github/workflows/docs-preview-local.yml
  • .github/workflows/license.yml
  • .github/workflows/prerelease.yml
  • .github/workflows/release.yml
  • .github/workflows/required-labels.yml
  • .github/workflows/smoke-test.yml
  • .github/workflows/updatecli.yml
  • .github/workflows/zizmor.yml
  • .github/zizmor.yml
  • actions/update-link-index/action.yml

Comment thread .github/workflows/smoke-test.yml Outdated
Quote landing-page-path test operands and use POSIX '=' so empty matrix
values do not break test. Restore checkout credentials for major tag push.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Mpdreamz Mpdreamz temporarily deployed to integration-tests June 1, 2026 11:13 — with GitHub Actions Inactive
@Mpdreamz Mpdreamz merged commit 4856b14 into main Jun 1, 2026
25 checks passed
@Mpdreamz Mpdreamz deleted the featue/zizmor branch June 1, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation packaging, ci/cd.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants